package com.jungle.app.domain.entity;

import com.jungle.pojo.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

@Data
@EqualsAndHashCode(callSuper = false)
@Entity
@Table(name = "img_link_data")
@org.hibernate.annotations.Table(appliesTo = "img_link_data", comment = "图片链接数据表")
@Where(clause = "deleted is null or deleted != true")
@SQLDelete(sql = "update img_link_data set deleted = true where id = ? ")
public class ImgLinkData extends BaseEntity {
    /**
     * 关联sys_oss表，获取文件信息
     */
    @Comment("sys_oss表oss_id")
    @Column(name = "oss_id")
    private Long ossId;

    //跳转连接
    @Comment("跳转连接")
    @Column(name = "hrefUrl")
    private String hrefUrl;

    /**
     * 图片链接，后台自动拼接，aliyun的url+图片名
     */
    @Comment("图片链接")
    @Column(name = "imgUrl")
    private String imgUrl;

    //跳转类型
    @Comment("跳转类型")
    @Column(name = "type")
    private String type;

    //使用地方
    @Comment("用途")
    @Column(name = "use_to")
    private String useTo;

    //图片名，文件名+后缀
    @Comment("图片名")
    @Column(name = "img_name")
    private String imgName;
    //图片描述
    @Comment("图片描述")
    @Column(name = "description")
    private String description;
}
